package com.xpqh.ksg.base;


import com.xpqh.ksg.common.enums.result.BizSuccessEnum;
import common.utils.DateUtil;

import java.io.Serializable;
import java.util.Date;

public class BaseResponseDTO implements Serializable{
	/** */
	private static final long serialVersionUID = 2627434076835332278L;

	private Integer status;
	private String message;
	private String timeStamp;
	private Object data; // 返回的对象
	
	//构造函数，响应成功返回调用
	public BaseResponseDTO() {
		super();
		this.data = null;
		this.status = BizSuccessEnum.OK.getCode();
		this.message = BizSuccessEnum.OK.getMessage();
		this.timeStamp = DateUtil.toCNDateTime(new Date());
	}
	
	//构造函数，响应成功返回调用
	public BaseResponseDTO(Object data) {
		super();
		this.data = data;
		this.status = BizSuccessEnum.OK.getCode();
		this.message = BizSuccessEnum.OK.getMessage();
		this.timeStamp = DateUtil.toCNDateTime(new Date());
	}

	//构造函数
	public BaseResponseDTO(Integer status, String message) {
		super();
		this.status = status;
		this.message = message;
		this.timeStamp = DateUtil.toCNDateTime(new Date());
	}
	
	//构造函数，自定义返回提示和错误码
	public BaseResponseDTO(Object data, Integer status, String message) {
		super();
		this.data = data;
		this.status = status;
		this.message = message;
		this.timeStamp = DateUtil.toCNDateTime(new Date());
	}
	
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getTimeStamp() {
		return timeStamp;
	}
	public void setTimeStamp(String timeStamp) {
		this.timeStamp = timeStamp;
	}
	
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}
